SET SERVEROUTPUT ON

--Altering SESSION to 'DD-MM-YYYY HH24:MI:SS'
ALTER SESSION SET nls_date_format = 'DD-MM-YYYY HH24:MI:SS';

--Creating the Logoff_Trigger.
CREATE or REPLACE TRIGGER
   logoff_trigger
BEFORE LOGOFF ON DATABASE
BEGIN
--Updating the user end time when the particular user loggs off.
UPDATE user_action_log
	SET
	   end_time = sysdate
	WHERE username=user;
END;
/
